/**
 * @Title: MailSenderInfo.java
 * @Package com.sunbeam.common.utils.mail
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2013/09/25 15:35:10
 * @version V1.0
 */

package com.sunbeam.common.utils.mail;

import java.util.Properties;    

import com.sunbeam.common.utils.encrypt.EncryptUtils;
/**
 * @ClassName: MailSenderInfo
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2013/09/25 15:35:10
 */

public class MailSenderInfo {    

	// 发送邮件的服务器的IP和端口    
    private String mailServerHost;    
    private String mailServerPort = "25";    
    // 邮件发送者的地址    
    private String fromAddress;    
    // 邮件接收者的地址    
    private String toAddress;    
    // 登陆邮件发送服务器的用户名和密码    
    private String userName;    
    private String password;    
    // 是否需要身份验证    
    private boolean validate = false;    
    // 邮件主题    
    private String subject;    
    // 邮件的文本内容    
    private String content;    
    // 邮件附件的文件名    
    private String[] attachFileNames;      
    /**   
      * 获得邮件会话属性   
      */    
    public Properties getProperties(){    
      Properties p = new Properties();    
      p.put("mail.smtp.host", this.mailServerHost);    
      p.put("mail.smtp.port", this.mailServerPort);    
      p.put("mail.smtp.auth", validate ? "true" : "false");    
      return p;    
    }    
    /**
     * 
     * @Title: getMailServerHost
     * @Description: TODO
     * @param @return
     * @return String
     * @throws
     */
    public String getMailServerHost() {    
        return mailServerHost;    
      }  
    
    /**
     * 
     * @Title: setMailServerHost
     * @Description: TODO
     * @param @param mailServerHost
     * @return void
     * @throws
     */
      public void setMailServerHost(String mailServerHost) {    
        this.mailServerHost = mailServerHost;    
      } 
      
      /**
       * 
       * @Title: getMailServerPort
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getMailServerPort() {    
        return mailServerPort;    
      }
      
      /**
       * 
       * @Title: setMailServerPort
       * @Description: TODO
       * @param @param mailServerPort
       * @return void
       * @throws
       */
      public void setMailServerPort(String mailServerPort) {    
        this.mailServerPort = mailServerPort;    
      }
      
      /**
       * 
       * @Title: isValidate
       * @Description: TODO
       * @param @return
       * @return boolean
       * @throws
       */
      public boolean isValidate() {    
        return validate;    
      }

      /**
       * 
       * @Title: setValidate
       * @Description: TODO
       * @param @param validate
       * @return void
       * @throws
       */
      public void setValidate(boolean validate) {    
        this.validate = validate;    
      }

      /**
       * 
       * @Title: getAttachFileNames
       * @Description: TODO
       * @param @return
       * @return String[]
       * @throws
       */
      public String[] getAttachFileNames() {    
        return attachFileNames;    
      }

      /**
       * 
       * @Title: setAttachFileNames
       * @Description: TODO
       * @param @param fileNames
       * @return void
       * @throws
       */
      public void setAttachFileNames(String[] fileNames) {    
        this.attachFileNames = fileNames;    
      }

      /**
       * 
       * @Title: getFromAddress
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getFromAddress() {    
        return fromAddress;    
      }

      /**
       * 
       * @Title: setFromAddress
       * @Description: TODO
       * @param @param fromAddress
       * @return void
       * @throws
       */
      public void setFromAddress(String fromAddress) {    
        this.fromAddress = fromAddress;    
      }

      /**
       * 
       * @Title: getPassword
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getPassword() {    
        return password;    
      }

      /**
       * 
       * @Title: setPassword
       * @Description: TODO
       * @param @param password
       * @return void
       * @throws
       */
      public void setPassword(String password) {    
        this.password = password;    
      }
      
      /**
       * 
       * @Title: setEncryptedPassword
       * @Description: TODO
       * @param @param password
       * @return void
       * @throws
       */
      public void setEncryptedPassword(String password) {    
          this.password = EncryptUtils.decrypt2StringByDES(password);    
      }

      /**
       * 
       * @Title: getToAddress
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getToAddress() {    
        return toAddress;    
      }

      /**
       * 
       * @Title: setToAddress
       * @Description: TODO
       * @param @param toAddress
       * @return void
       * @throws
       */
      public void setToAddress(String toAddress) {    
        this.toAddress = toAddress;    
      }

      /**
       * 
       * @Title: getUserName
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getUserName() {    
        return userName;    
      }

      /**
       * 
       * @Title: setUserName
       * @Description: TODO
       * @param @param userName
       * @return void
       * @throws
       */
      public void setUserName(String userName) {    
        this.userName = userName;    
      }

      
      /**
       * 
       * @Title: setEncryptUserName
       * @Description: TODO
       * @param @param userName
       * @return void
       * @throws
       */
      public void setEncryptedUserName(String userName) {    
    	  this.userName = EncryptUtils.decrypt2StringByDES(userName);    
      }
      
      
      /**
       * 
       * @Title: getSubject
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getSubject() {    
        return subject;    
      }

      /**
       * 
       * @Title: setSubject
       * @Description: TODO
       * @param @param subject
       * @return void
       * @throws
       */
      public void setSubject(String subject) {    
        this.subject = subject;    
      }

      /**
       * 
       * @Title: getContent
       * @Description: TODO
       * @param @return
       * @return String
       * @throws
       */
      public String getContent() {    
        return content;    
      }

      /**
       * 
       * @Title: setContent
       * @Description: TODO
       * @param @param textContent
       * @return void
       * @throws
       */
      public void setContent(String textContent) {    
        this.content = textContent;    
      }    
    
}

